package com.example.springboot010exceptionhandler.controller;

import com.example.springboot010exceptionhandler.domain.User;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: TODO
 * @author: uu
 * @data: 2023/7/8 上午 10:21
 * @version: v1.0
 */

@RestController
public class NumberController {

    @GetMapping("/divide")
    public String some(Integer n1, Integer n2){
        int result = n1/n2;
        return "n1 / n2 " + result;
    }
    @PostMapping("/order/new")
    public String createOrder(@Validated @RequestBody User user){
        return user.toString();
    }
}
